/**
 * 
 */
package com.I9lou.se.lurker;

import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Lurker启动主程序
 * @author chenwei
 * @date 2011-03-08
 */
public final class LurkerStarter {
	
	public static void main(String[] args) {
		final long startTime = System.currentTimeMillis();
		printToConsole("Starting Lurker...");
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"context/lurker-*.xml"});
		context.registerShutdownHook();
		printToConsole( "Lurker startup in " + (System.currentTimeMillis() - startTime) + " ms" );
		printToConsole( "Lurker's rmi listening port *: " + System.getProperty("lurker.rmi.port") );
	}
	
	private static void printToConsole(String message) {
		String currentDate = DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss");
		System.out.println(currentDate + " " + message );
	}
	
}
